/*
 * 
 * 
 * 
 */
package com.hboxs.asl.service.impl;

import com.hboxs.asl.Page;
import com.hboxs.asl.Pageable;
import com.hboxs.asl.dao.EssayDao;
import com.hboxs.asl.entity.Category;
import com.hboxs.asl.entity.Essay;
import com.hboxs.asl.entity.Member;
import com.hboxs.asl.service.EssayService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Service - 文章
 */
@Service("essayServiceImpl")
public class EssayServiceImpl extends BaseServiceImpl<Essay, Long> implements EssayService {

    @Resource(name = "essayDaoImpl")
    private EssayDao essayDao;

    @Resource(name = "essayDaoImpl")
    public void setBaseDao(EssayDao essayDao) {
        super.setBaseDao(essayDao);
    }

    @Override
    public Page<Essay> findPageByCategory(Pageable pageable, Member teacher, Category category) {
        return essayDao.findPageByCategory(pageable, teacher, category);
    }

    @Override
    public Page<Essay> findPageByTeacher(Pageable pageable, Member teacher) {
        return essayDao.findPageByTeacher(pageable, teacher);
    }

    @Override
    public Page<Essay> findPageByCategory(Pageable pageable, Category category) {
        return essayDao.findPageByCategory(pageable, category);
    }
}
